import java.util.Scanner;
public class Zuoye12 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int start=0;
        int middle,end;
        int a[]= {10,15,23,54,12,75,86,57,14,63};
        for(int i=0;i<a.length;i++) {
            for(int j=i+1;j<a.length;j++) {
                if(a[j]<a[i]) {
                    int temp=a[j];
                    a[j]=a[i];
                    a[i]=temp;
                }
            }
        }
        System.out.println("请输入要判断的整数:");
        int number=in.nextInt();
        int count=0;
        end=a.length;
        middle=(start+end)/2;
        while(number!=a[middle]) {
            if(number>a[middle]) {
                start=middle;
            }else {
                end=middle;
            }
            middle=(start+end)/2;
            count++;
            if(count>a.length/2) {
                break;
            }
        }
        if(count>a.length/2) {
            System.out.println(number+"不在数组中");
        }else {
            System.out.println(number+"在数组中");
        }
    }
}
